package com.oto.web.resource;

import java.util.List;

import javax.ws.rs.Path;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.oto.model.MessageDO;
import com.oto.service.MessageService;

/**
 * @author xueqiang.mi
 * @since 2011-1-12
 */
@Path("/message")
@Component
@Scope(BeanDefinition.SCOPE_SINGLETON)
public class MessageResource {
	@Autowired
	protected MessageService messageService;

	public List<MessageDO> getLattestMessages() {
		return messageService.lattest();
	}
}
